var status = -1;
var selectionLog = [];

function start() {
    action(1, 0, 0)
}

function action(d, c, b) {
    if (status == 0 && d == 0) {
        cm.dispose();
        return
    }
    status++;
    selectionLog[status] = b;
    var a = -1;
    if (status <= a++) {
        cm.dispose()
    } else {
        if (status === a++) {
            if (cm.getQuestStatus(31349) > 0) {
                if (cm.isQuestFinished(31351) && cm.getMapId() == 240092101) {
                    cm.warp(240092100, 0, true)
                } else {
                    if (!cm.isQuestFinished(31351) && cm.getMapId() == 240092100) {
                        cm.warp(240092101, 0, true)
                    }
                }
            }
            cm.dispose()
        }
    }
};